<?php
// +-------------------------------------------------------------------
// | 
// +-------------------------------------------------------------------
// | Copyright (c) 2009-2016 All rights reserved.
// +-------------------------------------------------------------------
namespace Admin\Controller;

use Kcdns\Admin\Controller\CommonController;
use Think\Exception;

class DouyinController extends CommonController
{
	public function add()
	{
		try {
			if (IS_POST) {
				$zhubo_nickname = I('post.douyin.zhubo_nickname', '');
				if (!$zhubo_nickname) {
					throw new Exception('主播名必须填写');
				}
				$mid = I('post.douyin.mid', '');
				if (!$mid) {
					throw new Exception('操作人必须选择');
				}
			}

			$data = M('douyin')->where(['zhubo_nickname' => I('post.douyin.mid', '')])->find();
			if ($data) throw new Exception('主播名已存在');

			parent::add();
		} catch (\Exception $e) {
			$this->error($e->getMessage());
		}
	}
    

    
    
    
}